3.231 \(\int \cos (c+d x) (a \sin (c+d x)+b \tan (c+d x)) \, dx\)

Optimal. Leaf size=22 \[ -\frac {(a \cos (c+d x)+b)^2}{2 a d} \]

[Out]

-1/2*(b+a*cos(d*x+c))^2/a/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 29, normalized size of antiderivative = 1.32, number of steps used = 5, number of rules used = 5, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.208, Rules used = {4377, 12, 2638, 2564, 30} \[ \frac {a \sin ^2(c+d x)}{2 d}-\frac {b \cos (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]*(a*Sin[c + d*x] + b*Tan[c + d*x]),x]

[Out]

-((b*Cos[c + d*x])/d) + (a*Sin[c + d*x]^2)/(2*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2564

Int[cos[(e_.) + (f_.)*(x_)]^(n_.)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(a*f), Subst[Int[
x^m*(1 - x^2/a^2)^((n - 1)/2), x], x, a*Sin[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n - 1)/2] &&
 !(IntegerQ[(m - 1)/2] && LtQ[0, m, n])

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 4377

Int[(u_)*((v_) + (d_.)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^(n_.)), x_Symbol] :> With[{e = FreeFactors[Cos[c*(a +
b*x)], x]}, Int[ActivateTrig[u*v], x] + Dist[d, Int[ActivateTrig[u]*Sin[c*(a + b*x)]^n, x], x] /; FunctionOfQ[
Cos[c*(a + b*x)]/e, u, x]] /; FreeQ[{a, b, c, d}, x] &&  !FreeQ[v, x] && IntegerQ[(n - 1)/2] && NonsumQ[u] &&
(EqQ[F, Sin] || EqQ[F, sin])

Rubi steps

\begin {align*} \int \cos (c+d x) (a \sin (c+d x)+b \tan (c+d x)) \, dx &=a \int \cos (c+d x) \sin (c+d x) \, dx+\int b \sin (c+d x) \, dx\\ &=b \int \sin (c+d x) \, dx+\frac {a \operatorname {Subst}(\int x \, dx,x,\sin (c+d x))}{d}\\ &=-\frac {b \cos (c+d x)}{d}+\frac {a \sin ^2(c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.01, size = 40, normalized size = 1.82 \[ -\frac {a \cos ^2(c+d x)}{2 d}+\frac {b \sin (c) \sin (d x)}{d}-\frac {b \cos (c) \cos (d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]*(a*Sin[c + d*x] + b*Tan[c + d*x]),x]

[Out]

-((b*Cos[c]*Cos[d*x])/d) - (a*Cos[c + d*x]^2)/(2*d) + (b*Sin[c]*Sin[d*x])/d

________________________________________________________________________________________

fricas [A]  time = 0.41, size = 25, normalized size = 1.14 \[ -\frac {a \cos \left (d x + c\right )^{2} + 2 \, b \cos \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(a*cos(d*x + c)^2 + 2*b*cos(d*x + c))/d

________________________________________________________________________________________

giac [B]  time = 0.27, size = 102, normalized size = 4.64 \[ -\frac {a \cos \left (2 \, d x + 2 \, c\right )}{4 \, d} - \frac {b \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x\right )^{2} - 4 \, b \tan \left (\frac {1}{2} \, d x\right ) \tan \left (\frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, c\right )^{2} + b}{d \tan \left (\frac {1}{2} \, d x\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + d \tan \left (\frac {1}{2} \, d x\right )^{2} + d \tan \left (\frac {1}{2} \, c\right )^{2} + d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*a*cos(2*d*x + 2*c)/d - (b*tan(1/2*d*x)^2*tan(1/2*c)^2 - b*tan(1/2*d*x)^2 - 4*b*tan(1/2*d*x)*tan(1/2*c) -
b*tan(1/2*c)^2 + b)/(d*tan(1/2*d*x)^2*tan(1/2*c)^2 + d*tan(1/2*d*x)^2 + d*tan(1/2*c)^2 + d)

________________________________________________________________________________________

maple [A]  time = 0.03, size = 26, normalized size = 1.18 \[ -\frac {\frac {\left (\cos ^{2}\left (d x +c \right )\right ) a}{2}+b \cos \left (d x +c \right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x)

[Out]

-1/d*(1/2*cos(d*x+c)^2*a+b*cos(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 0.41, size = 25, normalized size = 1.14 \[ -\frac {a \cos \left (d x + c\right )^{2} + 2 \, b \cos \left (d x + c\right )}{2 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*(a*cos(d*x + c)^2 + 2*b*cos(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 0.63, size = 28, normalized size = 1.27 \[ -\frac {\left (\cos \left (c+d\,x\right )+1\right )\,\left (2\,b-a+a\,\cos \left (c+d\,x\right )\right )}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(c + d*x)*(a*sin(c + d*x) + b*tan(c + d*x)),x)

[Out]

-((cos(c + d*x) + 1)*(2*b - a + a*cos(c + d*x)))/(2*d)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)*(a*sin(d*x+c)+b*tan(d*x+c)),x)

[Out]

Integral((a*sin(c + d*x) + b*tan(c + d*x))*cos(c + d*x), x)

________________________________________________________________________________________